<html>
    <head>
        <title>Welcome to Grails</title>
		<meta name="layout" content="main" />
    </head>
    <body>
        <h1 style="margin-left:20px;">Welcome to Grails</h1>
        <p style="margin-left:20px;width:80%">Congratulations, you have successfully started your first Grails application! At the moment
        this is the default page, feel free to modify it to either redirect to a controller or display whatever
        content you may choose. Below is a list of controllers that are currently deployed in this application,
        click on each to execute its default action:</p>
        <div class="dialog" style="margin-left:20px;width:60%;"> <br>
            <ul>
            <g:form controller="library" action="search" method="GET">
            	<table>
            		<tr>
            			<td> <a href="<g:createLink controller="index" />" > Go to Index page</a> </td>
            			<td> </td>
            		</tr>
            		<tr>
            			<td> Query String : </td>
            			<td> <g:textField name="query" /> </td>
            		</tr>
            		<tr>
            			<td> Select the field :</td>
            			<td> <g:select name="description" from="${['filename','description']}" /></td>
            		</tr>
            		<tr>
            			<td> </td>
            			<td> <input type="Submit" value="Search!" /></td>
            		</tr>
            
           		</table>
            </g:form>
            
            <table>
            	<g:if test="${books != null}" >
            		<g:each in="${books?}">
		            	<tr>
		            		<td>${it?.description} </td>
		            		<td>${it?.bookname} </td>
		            	</tr>
	            	</g:each>
            	</g:if>
            </table>
            </ul>
        </div>	   
    </body>
</html>